package com.ldpp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ldpp.backtesting.BackParam;
import com.ldpp.entity.TickMin;
import com.ldpp.mapper.TickMinMapper;
import com.ldpp.service.TickMinService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：gongtan
 * @date ：Created in 2021/3/16 15:24
 * @description：
 * @modified By：
 */
@Service
@AllArgsConstructor
public class TickMinServiceImpl extends ServiceImpl<TickMinMapper, TickMin> implements TickMinService {
    /**
     * 根据时间段获取回测所需交易tick数据 m级别
     * @author gt
     * @date 2021-03-16 15:32
     * @param backParam
     * @return
    */
    @Override
    public List<TickMin> getTickByTimeCup(BackParam backParam) {
        return this.getBaseMapper().getTickByTimeCup(backParam.getStartTime(),backParam.getEndTime(),backParam.getSymbol());
    }
}
